#pragma once
#include<iterator>
#include"tree.hh"
#include <memory>

using namespace std;

//Typedeffing this as an std::vector will allow us to use the standard std::vector iterators
//as well as c++ 11 move semantics...all the functions that would iterate through the tree
//can just do it and return a filled vector of the results in constant time.  There is no performance
//penalty for doing this.
class xmlnode;
typedef std::vector<std::shared_ptr<xmlnode>> xmlnodes;

/*
// Forward declaration to avoid compile errors
class xmlnode;


// This class serves an an abstraction to the 
// collection of xml nodes.
class xmlnodes
{
public:
	// Constructors
	xmlnodes(): begin_node(0), end_node(0){ }
	xmlnodes(tree<xmlnode>::iterator_base begin,
		tree<xmlnode>::iterator_base end) : begin_node(begin), end_node(end) { }
	
	// These can be used by the client to point to some 
	// xmlnode collection created by him. However, we do not use 
	// to avoid the leakage of internal data out
	// of our API.
	class iterator :
		public std::iterator<std::bidirectional_iterator_tag, xmlnode> {
		// TODO : define all the iterator methods here 
	 };

	// We will have only constant iterators so that the 
	// client does not possibly screw up with our internal tree
	// representation of the xml.
	class const_iterator :
		public std::iterator<std::bidirectional_iterator_tag, const xmlnode> {
		// TODO : define all the iterator methods here
	 };

	// Returns the iterator pointing to the beginning
	// element of the xmlnodes collection.
	const_iterator begin() const;
	
	
	// Returns the iterator pointing to the last
	// node of the xmlnodes collection.
	const_iterator end() const;

	// Returns true if the xmlnodes collection is empty
	bool is_empty() const;

private:
	tree<xmlnode>::iterator_base begin_node;
	tree<xmlnode>::iterator_base end_node;
};
 */

